using ASP;
using HoWave.Common;
using System;
using System.Web.Profile;
using System.Web.UI;
using System.Web.UI.WebControls;
public class Shop_UserControls_ProductDetailSearch : UserControl
{
	protected CheckBox s_standprice;
	protected CheckBox s_auction;
	protected CheckBox s_teambuy;
	protected CheckBox s_secondhand;
	protected CheckBox s_new;
	protected TextBox startprice;
	protected TextBox endprice;
	protected RangeValidator RangeValidator1;
	protected RangeValidator RangeValidator2;
	protected TextBox Address;
	protected TextBox KeyWord;
	protected Button Button1;
	private string m_classid;
	protected DefaultProfile Profile
	{
		get
		{
			return (DefaultProfile)this.Context.Profile;
		}
	}
	protected global_asax ApplicationInstance
	{
		get
		{
			return (global_asax)this.Context.ApplicationInstance;
		}
	}
	public string ClassID
	{
		get
		{
			if (string.IsNullOrEmpty(this.m_classid))
			{
				if (base.Request["ClassID"] != "" && base.Request["ClassID"] != null)
				{
					this.m_classid = base.Request["ClassID"];
				}
				else
				{
					this.m_classid = base.Request["parentid"];
				}
			}
			return this.m_classid;
		}
		set
		{
			this.m_classid = value;
		}
	}
	protected void Page_Load(object sender, EventArgs e)
	{
		if (!base.IsPostBack)
		{
			this.s_standprice.Checked = (Fetch.Get("stanprice") == "1");
			this.s_auction.Checked = (Fetch.Get("auction") == "1");
			this.s_teambuy.Checked = (Fetch.Get("teambuy") == "1");
			this.s_secondhand.Checked = (Fetch.Get("secondhand") == "1");
			this.s_new.Checked = (Fetch.Get("isnew") == "1");
			this.startprice.Text = Fetch.Get("startprice");
			this.endprice.Text = Fetch.Get("endprice");
			this.Address.Text = Fetch.Get("place");
		}
	}
	protected void Button1_Click(object sender, EventArgs e)
	{
		string text = "";
		string text2 = "";
		string text3 = "";
		string text4 = "";
		string text5 = "";
		string text6 = "";
		string text7 = "";
		string text8 = "";
		string text9 = "";
		if (this.s_standprice.Checked)
		{
			text = "1";
		}
		if (this.s_auction.Checked)
		{
			text2 = "1";
		}
		if (this.s_teambuy.Checked)
		{
			text3 = "1";
		}
		if (this.s_secondhand.Checked)
		{
			text5 = "1";
		}
		if (this.s_new.Checked)
		{
			text4 = "1";
		}
		if (this.startprice.Text != "")
		{
			try
			{
				decimal num = decimal.Parse(this.startprice.Text);
			}
			catch (Exception ex)
			{
				ex.WriteErrorLog(new string[0]);
				return;
			}
			text6 = this.startprice.Text;
		}
		if (this.endprice.Text != "")
		{
			try
			{
				decimal num2 = decimal.Parse(this.endprice.Text);
			}
			catch (Exception ex)
			{
				ex.WriteErrorLog(new string[0]);
				return;
			}
			text7 = this.endprice.Text;
		}
		if (this.Address.Text != "")
		{
			text9 = this.Address.Text;
		}
		if (this.KeyWord.Text != "")
		{
			text8 = base.Server.HtmlEncode(this.KeyWord.Text);
		}
		string text10 = this.Page.Request.Url.ToString().ToLower();
		base.Response.Redirect(string.Concat(new string[]
		{
			"ProductList.aspx?stanprice=",
			text,
			"&auction=",
			text2,
			"&teambuy=",
			text3,
			"&isnew=",
			text4,
			"&secondhand=",
			text5,
			"&startprice=",
			text6,
			"&endprice=",
			text7,
			"&title=",
			text8,
			"&place=",
			text9,
			"&parentid=",
			this.ClassID
		}));
	}
}
